package cn.momoshenchi.medicine.enumerate;

/**
 * @version : 1.0
 * @author: momoshenchi
 * @date: 2021/7/16 - 8:57
 */

public enum ResultCode
{
    /* 成功状态码 */
    SUCCESS(200, "success"),
    /* 请求状态码 */
    REQUEST_TYPE_ERROR(300, "请求类型不支持"),
    /* 系统异常状态码 */
    SYSTEM_ERROR(500, "系统异常请重试"),
    /* 参数错误 */
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(1003, "参数类型错误"),


    /* 用户错误 2001-2999*/
    USER_NOTLOGGED_IN(2001, "用户未登录"),
    USER_LOGIN_ERROR(2002, "账号不存在或密码错误");


    private final Integer code;
    private final String message;

    private ResultCode(Integer code, String message)
    {
        this.code = code;
        this.message = message;
    }

    public Integer code()
    {
        return this.code;
    }

    public String message()
    {
        return this.message;
    }
}

